import request from '@/utils/request'

// 获取所有权限
export function getPermissions() {
  return request({
    url: '/admin/permissions',
    method: 'get'
  })
}

// 获取路由权限列表
export function getRoutePermissions() {
  return request({
    url: '/admin/route-permissions',
    method: 'get'
  })
}

// 获取菜单权限列表
export function getMenuPermissions() {
  return request({
    url: '/admin/menu-permissions',
    method: 'get'
  })
}

// 创建权限
export function createPermission(data) {
  return request({
    url: '/admin/permissions',
    method: 'post',
    data
  })
}

// 更新权限
export function updatePermission(id, data) {
  return request({
    url: `/admin/permissions/${id}`,
    method: 'put',
    data
  })
}

// 删除权限
export function deletePermission(id) {
  return request({
    url: `/admin/permissions/${id}`,
    method: 'delete'
  })
} 